package com.example.myapplication22;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
    Button b3;//英雄资料
    Button b4;//开黑交友
    Button b5;//聊天室
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        b3=(Button) findViewById(R.id.button3);
        b4=(Button) findViewById(R.id.button4);
        b5=(Button) findViewById(R.id.button5);
        b3.setOnClickListener(this);
        b4.setOnClickListener(this);
        b5.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        if (v.getId()==R.id.button3){
            WebView webView=(WebView)findViewById(R.id.idWebView);
                  //调用loadUrl()方法嵌入百度新闻页面
             webView.loadUrl("https://www.op.gg/");
            //内嵌App，不以浏览器的方式打开
            webView.setWebViewClient(new WebViewClient());

        }
        else if(v.getId()==R.id.button4){
            Intent intent = new Intent();
            intent.setClass(LoginActivity.this,PhoneActivity.class);
            startActivity(intent);

        }
        else if(v.getId()==R.id.button5){
            Intent intent = new Intent();
            intent.setClass(LoginActivity.this,ChatActivity.class);
            startActivity(intent);

        }
    }
}
